<?php

namespace app\command;

use app\api\logic\GoodsSearchLogic;
use DI\Attribute\Inject;
use support\service\MqClient;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;


class GoodsSync extends Command
{
    protected static $defaultName = 'goods_sync';
    protected static $defaultDescription = '同步商品数据到meilisearch';

    /**
     * @return void
     */
    protected function configure()
    {
//        $this->addArgument('name', InputArgument::OPTIONAL, 'Name description');
    }

    #[Inject]
    protected MqClient $mq;

    /**
     * @param InputInterface $input
     * @param OutputInterface $output
     * @return int
     */
    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        GoodsSearchLogic::fullSync();
        return self::SUCCESS;
    }

}
